package mysql

import "gorm.io/gorm"

type Good struct {
	gorm.Model
	Title       string `gorm:"type:varchar(20);not null;index:ip_idx"`
	Price       int    `gorm:"type:int(20);not null;"`
	Stock       int    `gorm:"type:int(20);not null;"`
	Status      string `gorm:"type:varchar(20);not null;"`
	LikeCollect int    `gorm:"type:int(20);not null;"`
}

func (G *Good) GoodFind(GoodId int) error {
	return DB.Debug().Model(&G).Where("id = ?", GoodId).Find(&G).Error
}
